package cn.com.cetccst.datacenter.policy.type;

import com.google.gson.annotations.SerializedName;

import java.util.List;

import cn.com.cetccst.datacenter.policy.fence.GFence;

public class BlackWhiteAppSetting {
    @SerializedName("enable")
    private boolean enable;
    @SerializedName("blackWhiteType")
    private boolean blackWhiteType;
    @SerializedName("validTime")
    private List<ValidTime> validTime;
    @SerializedName("validLocation")
    private GFence validLocation;
    @SerializedName("apps")
    private List<App> apps;
    @SerializedName("forbiddenApps")
    private List<App> forbiddenApps;

    public boolean isEnable() {
        return enable;
    }

    public boolean isBlackWhiteType() {
        return blackWhiteType;
    }

    public List<ValidTime> getValidTime() {
        return validTime;
    }

    public GFence getValidLocation() {
        return validLocation;
    }

    public List<App> getApps() {
        return apps;
    }

    public List<App> getForbiddenApps() {
        return forbiddenApps;
    }

    public static class ValidTime {

        @SerializedName("timeFrames")
        private List<TimeFrame> timeFrames;
        @SerializedName("dayOfWeek")
        private int dayOfWeek;

        public List<TimeFrame> getTimeFrames() {
            return timeFrames;
        }

        public int getDayOfWeek() {
            return dayOfWeek;
        }

        public static class TimeFrame {
            @SerializedName("start")
            private String start;
            @SerializedName("end")
            private String end;

            public String getStart() {
                return start;
            }

            public String getEnd() {
                return end;
            }
        }
    }

    public static class App {
        @SerializedName("appName")
        private String appName;
        @SerializedName("packageName")
        private String packageName;

        public String getAppName() {
            return appName;
        }

        public String getPackageName() {
            return packageName;
        }
    }
}
